package com.ui.element;

import java.awt.Color;
import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

public class HexTable extends JTable {

	private static final long serialVersionUID = -5706732841856093919L;

	public HexTable() {
		super();
	}

	public HexTable(Object[][] rowData, Object[] columnNames) {
		super(rowData, columnNames);
	}

	public boolean isCellEditable(int row, int column) {
		return false;
	}

	@SuppressWarnings("serial")
	public void setSelectedColor() {
		new DefaultTableCellRenderer() {
			public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
					boolean hasFocus, int row, int column) {
				if (isSelected) {
					setForeground(Color.green);
				}
				return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
			}
		};
	}

}
